package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the SMALL_OFFICE database table.
 * 
 */
@Entity
@Table(name="SMALL_OFFICE")
@NamedQuery(name="SmallOffice.findAll", query="SELECT s FROM SmallOffice s")
public class SmallOffice implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="SMALL_OFFICE_ID")
	private long smallOfficeId;

	private String name;

	//bi-directional many-to-one association to OfficeFunction
	@OneToMany(mappedBy="smallOffice")
	private List<OfficeFunction> officeFunctions;

	//bi-directional many-to-one association to BigOffice
	@ManyToOne
	@JoinColumn(name="BIG_OFFICE_ID")
	private BigOffice bigOffice;

	//bi-directional many-to-many association to Staff
	@ManyToMany(mappedBy="smallOffices")
	private List<Staff> staffs;

	public SmallOffice() {
	}

	public long getSmallOfficeId() {
		return this.smallOfficeId;
	}

	public void setSmallOfficeId(long smallOfficeId) {
		this.smallOfficeId = smallOfficeId;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<OfficeFunction> getOfficeFunctions() {
		return this.officeFunctions;
	}

	public void setOfficeFunctions(List<OfficeFunction> officeFunctions) {
		this.officeFunctions = officeFunctions;
	}

	public OfficeFunction addOfficeFunction(OfficeFunction officeFunction) {
		getOfficeFunctions().add(officeFunction);
		officeFunction.setSmallOffice(this);

		return officeFunction;
	}

	public OfficeFunction removeOfficeFunction(OfficeFunction officeFunction) {
		getOfficeFunctions().remove(officeFunction);
		officeFunction.setSmallOffice(null);

		return officeFunction;
	}

	public BigOffice getBigOffice() {
		return this.bigOffice;
	}

	public void setBigOffice(BigOffice bigOffice) {
		this.bigOffice = bigOffice;
	}

	public List<Staff> getStaffs() {
		return this.staffs;
	}

	public void setStaffs(List<Staff> staffs) {
		this.staffs = staffs;
	}

}